-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom archive mode #627
Custom archive mode #627
Conversation
Co-authored-by: Kyle Altendorf <[email protected]>
Co-authored-by: Kyle Altendorf <[email protected]>
welp, that was straightforward Co-authored-by: Kyle Altendorf <[email protected]>
Co-authored-by: Kyle Altendorf <[email protected]>
Co-authored-by: Kyle Altendorf <[email protected]>
Co-authored-by: lopesmcc <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
It doesn't seem that
src/plotman/resources/target_definitions.yaml
is being copied to the config dir when runningplotman config generate
. I'd expect it to be the case, since users will potentially need / want to set custom values -
Running
plotman archive
from a fresh install crashes with the following exception, asarch_cfg
is not being passed:
...starting archive loop
Traceback (most recent call last):
File "/usr/local/bin/plotman", line 33, in <module>
sys.exit(load_entry_point('plotman', 'console_scripts', 'plotman')())
File "/Users/rafaelsteil/Desktop/custom-archive/plotman/src/plotman/plotman.py", line 193, in main
archiving_status, log_messages = archive.spawn_archive_process(cfg.directories, jobs)
TypeError: spawn_archive_process() missing 1 required positional argument: 'all_jobs'
except FileNotFoundError as e: | ||
message = ( | ||
f'Unable to open log file. Verify that the directory exists' | ||
f' and has proper write permissions: {log_file_path!r}' | ||
) | ||
raise Exception(message) from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be prudent to check it on startup rather than here. I added a snipped in another comment.
elif args.cmd == 'archive': | ||
print('...starting archive loop') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a check to make sure we'll be able to actually write the logs before even starting: (related to another comment I made)
if not path.exists(cfg.directories.log) or not os.access(cfg.directories.log, os.W_OK):
print(f"Error: Directory '{cfg.directories.log}' doesn't exist or isn't writable")
sys.exit(1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of good catches here, thanks. Here are responses to some but not all of them.
target_definitions.yaml
is specifically for the builtin presets. Users can write their own target definitions in the regular plotman configuration at archiving: target_definitions: my_target:
(or whatever name they choose). So, I'll lump this into the 'needs documentation' task, unless I have missed your point. Probably a commented out example in the plotman.yaml
as well, I guess?
Further building on #88.
Draft for:
archive
subcommand work as well"12000"
, even if understandable as an environment variable key in the YAML/
-agnosticness?set -evx
for disk space script ends up outputting viastderr
in the interactive log